﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliBiliCSharpStudy.clazz.oop {
    class HelloOOP {
        public static void Demo() {
            //Test1();
            Test2();
        }

        public static void Test2() {
            Car car = new Car();
            Console.WriteLine(car is Car);
            Console.WriteLine(car is Vehicle);
            Console.WriteLine(car is Object);
            Vehicle vehicle = new Car();
        }

        public static void Test1() {
            Type t = typeof(Car);
            Console.WriteLine(t.Name);
            Console.WriteLine(t.FullName);
            Type tb = t.BaseType;
            Console.WriteLine(tb.FullName);
            Type tTop = tb.BaseType;
            Console.WriteLine(tTop.FullName);
            Console.WriteLine(tTop.BaseType == null);
        }
    }

    class Vehicle { }

    // `sealed`类不能作为基类
    //sealed class Vehicle { }

    // 一个类只能继承一个基类
    class Car : Vehicle { }
}




